import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LianBao
 * Date: 2024-09-13
 * Time: 22:57
 */
public class demo4 {
    public static void main(String[] args) throws InterruptedException {
//        BlockingQueue<Integer> queue = new ArrayBlockingQueue<>(2);
        MyBlockingQueue queue = new MyBlockingQueue(2);

        queue.put(1);
        System.out.println("put成功");

        queue.put(1);
        System.out.println("put成功");

        queue.get();
        System.out.println("take成功");

        queue.put(1);
        System.out.println("put成功");


    }
}
